//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.util;

import java.awt.Container;
import java.awt.Toolkit;
import javax.swing.*;
import org.jpgolay.me.Messages;

public class PrintSelectorGUI extends JFrame {

    public PrintSelectorGUI() {
        initComponents();
        setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/org/jpgolay/me/images/logo.gif")));
    }

    private void initComponents() {
        buttonGroup1 = new ButtonGroup();
        titreP = new JPanel();
        titreL = new JLabel();
        contenuP = new JPanel();
        listeRB = new JRadioButton();
        pieceRB = new JRadioButton();
        controleP = new JPanel();
        validerB = new JButton();
        annulerB = new JButton();
        setResizable(false);
        setUndecorated(true);
        titreL.setText(Messages.getString("PrintSelectorGUI.select_print"));
        titreP.add(titreL);
        getContentPane().add(titreP, "North");
        listeRB.setSelected(true);
        listeRB.setText(Messages.getString("PrintSelectorGUI.list"));
        listeRB.setToolTipText(Messages.getString("PrintSelectorGUI.print_list"));
        buttonGroup1.add(listeRB);
        contenuP.add(listeRB);
        pieceRB.setText(Messages.getString("PrintSelectorGUI.piece"));
        pieceRB.setToolTipText(Messages.getString("PrintSelectorGUI.piece_msg_tips"));
        buttonGroup1.add(pieceRB);
        contenuP.add(pieceRB);
        getContentPane().add(contenuP, "Center");
        validerB.setText(Messages.getString("PrintSelectorGUI.ok"));
        controleP.add(validerB);
        annulerB.setText(Messages.getString("PrintSelectorGUI.cancel"));
        controleP.add(annulerB);
        getContentPane().add(controleP, "South");
        pack();
    }

    public JButton getAnnulerB() {
        return annulerB;
    }

    public JButton getValiderB() {
        return validerB;
    }

    public void setTextPieceRB(String text) {
        pieceRB.setText(text);
    }

    public void setTextListeRB(String text) {
        listeRB.setText(text);
    }

    public int isSelected() {
        return !listeRB.isSelected() ? 1 : 0;
    }
    private JRadioButton pieceRB;
    private JButton validerB;
    private JLabel titreL;
    private JRadioButton listeRB;
    private JButton annulerB;
    private ButtonGroup buttonGroup1;
    private JPanel controleP;
    private JPanel titreP;
    private JPanel contenuP;
}
